import request from '@/utils/request'

const header = {
    'Content-Type': 'application/json;charset=utf-8'
}

const POST = (url, data = {}, headers = header) => request({
    url,
    method: 'post',
    data,
    headers
})

const GET = (url, data = {}, headers = header) => request({
    url,
    method: 'get',
    params: data,
    headers
})

const PUT = (url, data = {}, headers = header) => request({
    url,
    method: 'PUT',
    data,
    headers
})

const DELETE = (url, data = {}, headers = header) => request({
    url,
    method: 'DELETE',
    params: data,
    headers
})

//【流程管理】
export const actinitDeploymentBPMN = (p) => POST(`/act/processDefinition/initDeploymentBPMN`, p) //流程新增
export const actgetDefinitions = (p) => POST(`/act/processDefinition/getDefinitions`, p) //流程列表
export const actreadResource = (p) => GET(`/act/processDefinition/readResource`, p) //获取流程详情
export const actdelDeploymentBPMN = (p) => GET(`/act/processDefinition/delDeploymentBPMN/${p}`, {}) //删除流程
export const actgetStartFormData = (p) => GET(`/act/formDataController/getStartFormData`, p) //获取流程表单
export const actTaskControllerstart = (p) => POST(`/act/TaskController/start`, p) //发起流程
export const actTaskControllertasks = (p) => GET(`/act/TaskController/tasks`, p) //获取流程
export const actTaskControllercompleteTask = (p) => GET(`/act/TaskController/completeTask`, p) //完成流程
export const actTaskControllergetHistoryTask = (p) => GET(`/act/TaskController/getHistoryTask`, p) //获取流程历史节点